package ar.edu.itba.pod.Legajo47342.communication.payload;

import com.google.common.base.Preconditions;

import ar.edu.itba.pod.simul.communication.payload.ResourceTransferMessagePayload;
import ar.edu.itba.pod.simul.market.Resource;

public class ResourceTransferMessagePayloadImpl implements
		ResourceTransferMessagePayload {

	private static final long serialVersionUID = 1L;
	private Resource res;
	private int amount;
	private String sourceId;
	private String destinationId;

	public ResourceTransferMessagePayloadImpl(Resource res, int amount,
			String sourceId, String destinationId) {
		super();
		
		Preconditions.checkNotNull(res, "The resource cannot be null");
		Preconditions.checkNotNull(sourceId, "The source id cannot be null");
		Preconditions.checkNotNull(destinationId, "The destination id cannot be null");
		
		this.res = res;
		this.amount = amount;
		this.sourceId = sourceId;
		this.destinationId = destinationId;
	}

	@Override
	public Resource getResource() {
		return res;
	}

	@Override
	public int getAmount() {
		return amount;
	}

	@Override
	public String getSource() {
		return sourceId;
	}

	@Override
	public String getDestination() {
		return destinationId;
	}

}
